(function() {
  var MB_SIZE, status, _;

  _ = require('underscore');

  MB_SIZE = 1024 * 1024;

  /**
   * [status description]
   * @param  {[type]}   req  [description]
   * @param  {[type]}   res  [description]
   * @param  {Function} next [description]
   * @return {[type]}        [description]
  */


  status = function(req, res, next) {
    var memoryUsage, statusInfo;
    memoryUsage = process.memoryUsage();
    _.each(memoryUsage, function(value, key) {
      return memoryUsage[key] = Math.floor(value / MB_SIZE) + 'MB';
    });
    statusInfo = {
      argv: process.argv,
      versions: process.versions,
      NODE_ENV: process.env.NODE_ENV || 'development',
      pid: process.pid,
      execPath: process.execPath,
      memoryUsage: memoryUsage,
      uptime: process.uptime()
    };
    return res.send(JSON.stringify(statusInfo));
  };

  module.exports = {
    status: status
  };

}).call(this);
